steam_user_owns_dlc

语法:

steam_user_owns_dlc(dlc_id);


参数 描述
dlc_id The unique identifier for the DLC to be checked (an integer).


返回: 布尔值


描述

If your game has DLC created for it, you can use this function to check and see whether the user has bought it before accessing any files associated with it. The function returns true if the player owns the content, and false if the user does not, but note that even if the user owns the DLC, they may not have it installed, so you should use the additional function of steam_user_installed_dlc to check that it is installed as well before using it.


例如:

global.Level_Max = 100;
if steam_user_owns_dlc(10354)
   {
   if steam_user_installed_dlc(10354)
      {
      global.Level_max = 200;
      }
   }

The above code will check to see if the user has bought, and installed, the DLC with the id 10354, and if so set a global variable to a different value.